/*
 * @Author: 赵克强 huohuo625@163.com
 * @Date: 2023-11-06 16:46:44
 * @LastEditors: 赵克强 huohuo625@163.com
 * @LastEditTime: 2025-04-11 10:44:17
 * @FilePath: \hy-ui\src\api\render\pager.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import request from '@/utils/request'

export const getConfig = (pageCode) => {
    return request({
        url: `/frontView/page/config/${pageCode}`,
        method: 'get'
    })
}

export const crudQuery = (data) => {
    return request({
        url: `/frontView/page/crudQuery/${data.pageCode}`,
        method: 'post',
        data,
    })
}

export const crudQueryList = (pageCode,data) => {
    return request({
        url: `/frontView/page/crudQuery/${pageCode}`,
        method: 'post',
        data,
    })
}


export const getFormConfig = (code) => {
    return request({
        url:`/frontView/form/${code}`,
        method: 'get'
    })
}

export const getFormConfigFlow = (code) => {
    return request({
        url:`${code}`,
        method: 'get'
    })
}
export const saveOrUpdate = (formCode,data) => {
    return request({
        url: `/frontView/form/saveOrUpdate/${formCode}`,
        method: 'post',
        data
    })
}

export const FormDelete = (model,id) => {
    return request({
        url: `/frontView/form/${model}/delete/${id}`,
        method: 'post',
    })
}

export const appDictData = (data) => {
    return request({
        url: `/app/appDictData/batchList`,
        method: 'post',
        data
    })
}

export const frontViewData = (formCode,params) => {
    return request({
        url: `/frontView/form/${formCode}/get`,
        method: 'get',
        params
    })
}

export const batchListByType = (dictCodes) => {
    return request({
        url: `/app/appDictData/batchListByType/${dictCodes}`,
        method: 'get',
    })
}
export const getFlowDetailPath = (formCode,params) => {
    return request({
        url: `/frontView/process/getAssoProcess/${formCode}`,
        method: 'get',
        params
    })
}

export const getSystemDictLists = (dictCodes) => {
    return request({
        url: `/system/dict/data/batchListByType/${dictCodes}`,
        method: 'get',
    })
}

export const getColumns = (pageCode) => {
    return request({
        url: `/pageCustomColumn/getColumns/${pageCode}`,
        method: 'get',
    })
}

export const setColumns = (pageCode,data) => {
    return request({
        url: `/pageCustomColumn/setColumns/${pageCode}`,
        method: 'post',
        data
    })
}
export const crudExport = (pageCode) => {
    return request({
        url: `/frontView/page/crudExport/${pageCode}?page=1&perPage=10`,
        method: 'get',
    })
}